<?php
//用户注册
require("../config.php");
session_start();
//echo header("Content-Type: text/html; charset=utf-8");
//echo "var ret_s = 0; var ret_txt = ''; var ck = '';";
if ($_SERVER['REQUEST_METHOD'] == 'POST')
	{
		$uname = $class_go->C_title($_REQUEST['name']);
		$pass = $class_go->C_title($_REQUEST['pwd']);
		$pwd = md5(trim($pass));
		$email = $class_go->C_title($_REQUEST['mail']);
		$tel = $class_go->C_title($_REQUEST['tel']);
		$uid = $udb->sqls("select user_name from user_table where user_name='$uname'");
		if($uid!=null)
		{
			echo"<font color='red'>该用户已存在！！</font>";
			/*$URL="../../regist/index.php";
			header("Location: $URL");exit;*/
			echo "\n<!--Start header -->\n";
			require("../html/head.html");
			echo "\n<!--End header -->\n";
			echo "\n<!--Start Content -->\n";
			require("../html/join.html");
			echo "\n<!--End Content -->\n";
			echo "\n<!--Start Foot -->\n";
			require("../html/foot.html");
			echo "\n<!--End Foot -->\n";
		}
		else
		{
			$sqlset = $udb->sqls("insert into user_table (user_name,user_pass,user_mail,user_tel) values ('$uname','$pwd','$email',$tel)");
			//echo"<font color='red'>ok！！</font>";
			//require("../../index/MarketList.html");
			$uid = $udb->sqls("select user_id from user_table where user_name='".$uname."'");
			$uid = $uid[0]["user_id"];
			//$int_ID = $udb->sqls("insert into hdb_integral (user_ID,total_sum,join_sum,reducing,r_time,r_kg,pre) values ('$uid',1000,0,0,$addtime,0)");
			//$_SESSION["email"]=$email;
			$_SESSION["name"]=$uname;
			echo "\n<!--Start header -->\n";
			require("../html/head.html");
			echo "\n<!--End header -->\n";
			echo "\n<!--Start Content -->\n";
			require("../html/index.html");
			echo "\n<!--End Content -->\n";
			echo "\n<!--Start Foot -->\n";
			require("../html/foot.html");
			echo "\n<!--End Foot -->\n";
		}
		//require_once("/include/html/join.html");
}
//echo "ret = $ret_s;ret_txt = '$ret_txt';ck = '$ck';";
?>